****************************** FIGURE 1 ****************************** 
xtline TotalPassNorm13 if Year >=1975, ytitle(Citizenship Policy Change) ytitle(, orientation(horizontal)) ttitle(Time) ttitle(, alignment(middle)) tlabel(1975(10)2015, angle(forty_five)) byopts(title("Figure 1: Citizenship Policy Scores By Country, 1975-2014")) byopts(legend(off))
xtline PassICCITotal, ytitle(Citizenship Policy Change) ytitle(, orientation(horizontal)) ttitle(Time) ttitle(, alignment(middle)) tlabel(1965(10)2015, angle(forty_five)) byopts(legend(off))

****************************** FIGURE 2: Interactive Effects on Citizenship Policy Change  ********************************************************
****************************** ENLP x LRScore3
qui regress TotalPassNorm13Diff c.ENLP##ib2.LRScore3 ENRP logForBornPercent MigRateLag WBGDPGrowth i.ICCIStartType if Year >= 1975 , vce(cluster ElectionCode) // 
	margins , at(ENLP=(1(.5)3.5) LRScore3=(1) ) atmeans post 
	est store Figure2ENLPMargins1
qui regress TotalPassNorm13Diff c.ENLP##ib2.LRScore3 ENRP logForBornPercent MigRateLag WBGDPGrowth i.ICCIStartType if Year >= 1975 , vce(cluster ElectionCode) // 
	margins , at(ENLP=(1(.5)3.5) LRScore3=(2) ) atmeans post 
	est store Figure2ENLPMargins2
qui regress TotalPassNorm13Diff c.ENLP##ib2.LRScore3 ENRP logForBornPercent MigRateLag WBGDPGrowth i.ICCIStartType if Year >= 1975 , vce(cluster ElectionCode) // 
	margins , at(ENLP=(1(.5)3.5) LRScore3=(3) ) atmeans post 
	est store Figure2ENLPMargins3
	coefplot ///				 
			(Figure2ENLPMargins1, label("Left Governments") color(gs6) barwidth(0.25) bargap(1.5) ) ///	Estimates (reordered into a more logical order for results)
			(Figure2ENLPMargins2, label("Centrist Governments") color(gs12) barwidth(0.25) bargap(1.5)  ) //////		(c) "Offsets" distribute markers so they aren't stacked
			(Figure2ENLPMargins3, label("Right Governments") color(gs16) barwidth(0.25) bargap(1.5)  ) ///		(c) "Offsets" distribute markers so they aren't stacked
			, ///  
			vertical  ///  
			recast(bar) ///
			plotregion(margin(b=0)) /// Puts the bars right on x axis rather than having any space
			lcolor(black) /// bars will have blackoutline 
			citop barwidth(0.3) fcolor(*.5) /// add conf ints and put them ontop of the bars  
			ciopts(lwidth(*1) lcolor(black)  ) ///
			ylabel(,noticks) ///
			///
			legend (position(6) margin(tiny) bmargin(l+5 t+2)) ///			Position (o'clock and ring = 0 here to put legend in empty cell...
			/// legend (ring(4)) ///											Needs the bmargin settings adjusted to work well.
			legend(rows(2)) ///  											Rows(1) to put all of the legend labels on a horizontal line; cols(1) vert 
			legend(size(*.85) symysize(*.8) symxsize(*.6) keygap(vsmall) ) ///	Relative sizing to change the text size in the legend; gap bw marker and text
			///
			///
			///at recast(line) ///
			///
			///ciopts(recast(rline) lpattern(dash))
			ytitle("Predicted Citizenship Policy Change" , size(*.7) margin (l+.5 ) ) /// Margin moves the label out from the axis 
			yscale(range(-.4(.1).4)) ylabel(-.4(.1).4) ///
			ylabel(,labsize(*.6)) /// Size of the labels on the y-axis 
			ylabel(, grid glwidth(vthin) glcolor(gs10) glpattern(shortdash)) /// Look of the grid
			///
			b1title ("ENLP" , size(small)) /// xtitle("ENLP") /// b1title ("`figname'" , size(small)) /// using b1title puts stops the x-title from encroaching on x-axis
		/// Notice: Use "`figname'" so that first loop through grabs first "local figname" above to rotate axis names depending on dv 
			///xscale(range(.5 3.5)) /// Add a little space--.5 units here--at the front and end of the x-axis  
			xlabel(,labsize(*.55)) /// Size of the labels on the x-axis 			
			/// xlabel(, alternate) /// Angle of the labels on the x-axis 	
			/// xlabel(, angle(315)) /// Angle of the labels on the x-axis 	
			/// 
			xlabel( 1 `"1"'  2 `"1.5"' 3 `"2"' 4 `"2.5"' 5 `"3"' 6 `"3.5"') /// Label the 11 estimates created with each model above
			///
			title("Marginal Effects of ENLP on Citizenship Policy Change",size(*.5) color(black) margin(r+0 b-.5 t+5) ) /// margin(r+10 to move titles (r,l,b, t) to make room
			scale(.9) graphregion(color(white) margin(small)) /// scale graphy ; White background instead of Stata blue; margins to create space between figures 
			///graph display, xsize(2.5) ysize(2.5) /// Change these to increase/decrease figure dimensions
			saving(Figure2ENLPEffects.gph, replace)	
			///graph export "Figure1Libs1.tif", replace

****************************** ENRP x LRScore3
qui regress TotalPassNorm13Diff c.ENRP##ib2.LRScore3 ENLP logForBornPercent MigRateLag WBGDPGrowth i.ICCIStartType if Year >= 1975 , vce(cluster ElectionCode) // 
	margins , at(ENRP=(1(.5)3.5) LRScore3=(1) ) atmeans post 
	est store Figure2ENRPMargins1
qui regress TotalPassNorm13Diff c.ENRP##ib2.LRScore3 ENLP logForBornPercent MigRateLag WBGDPGrowth i.ICCIStartType if Year >= 1975 , vce(cluster ElectionCode) // 
	margins , at(ENRP=(1(.5)3.5) LRScore3=(2) ) atmeans post 
	est store Figure2ENRPMargins2
qui regress TotalPassNorm13Diff c.ENRP##ib2.LRScore3 ENLP logForBornPercent MigRateLag WBGDPGrowth i.ICCIStartType if Year >= 1975 , vce(cluster ElectionCode) // 
	margins , at(ENRP=(1(.5)3.5) LRScore3=(3) ) atmeans post 
	est store Figure2ENRPMargins3
	coefplot ///				 
			(Figure2ENRPMargins1, label("Left Governments") color(gs6) barwidth(0.25) bargap(1.5) ) ///	Estimates (reordered into a more logical order for results)
			(Figure2ENRPMargins2, label("Centrist Governments") color(gs12) barwidth(0.25) bargap(1.5)  ) //////		(c) "Offsets" distribute markers so they aren't stacked
			(Figure2ENRPMargins3, label("Right Governments") color(gs16) barwidth(0.25) bargap(1.5)  ) ///		(c) "Offsets" distribute markers so they aren't stacked
			, ///  
			vertical  ///  
			recast(bar) ///
			plotregion(margin(b=0)) /// Puts the bars right on x axis rather than having any space
			lcolor(black) /// bars will have blackoutline 
			citop barwidth(0.3) fcolor(*.5) /// add conf ints and put them ontop of the bars  
			ciopts(lwidth(*1) lcolor(black)  ) ///
			ylabel(,noticks) ///
			///
			legend (position(6) margin(tiny) bmargin(l+5 t+2)) ///			Position (o'clock and ring = 0 here to put legend in empty cell...
			/// legend (ring(4)) ///											Needs the bmargin settings adjusted to work well.
			legend(rows(2)) ///  											Rows(1) to put all of the legend labels on a horizontal line; cols(1) vert 
			legend(size(*.85) symysize(*.8) symxsize(*.6) keygap(vsmall) ) ///	Relative sizing to change the text size in the legend; gap bw marker and text
			///
			///
			///at recast(line) ///
			///
			///ciopts(recast(rline) lpattern(dash))
			ytitle("Predicted Citizenship Policy Change" , size(*.7) margin (l+.5 ) ) /// Margin moves the label out from the axis 
			yscale(range(-.4(.1).4)) ylabel(-.4(.1).4) ///
			ylabel(,labsize(*.6)) /// Size of the labels on the y-axis 
			ylabel(, grid glwidth(vthin) glcolor(gs10) glpattern(shortdash)) /// Look of the grid
			///
			b1title ("ENRP" , size(small))  /// xtitle("ENRP Score") /// b1title ("`figname'" , size(small)) /// using b1title puts stops the x-title from encroaching on x-axis
			/// Notice: Use "`figname'" so that first loop through grabs first "local figname" above to rotate axis names depending on dv 
			///xscale(range(.5 5.0)) /// Add a little space--.5 units here--at the front and end of the x-axis  
			xlabel(,labsize(*.55)) /// Size of the labels on the x-axis 			
			/// xlabel(, alternate) /// Angle of the labels on the x-axis 	
			/// xlabel(, angle(315)) /// Angle of the labels on the x-axis 	
			/// 
			xlabel( 1 `"1"'  2 `"1.5"' 3 `"2"' 4 `"2.5"' 5 `"3"' 6 `"3.5"') /// Label the 11 estimates created with each model above
			///
			title("Marginal Effects of ENRP on Citizenship Policy Change",size(*.5) color(black) margin(r+0 b-.5 t+5) ) /// margin(r+10 to move titles (r,l,b, t) to make room
			scale(.9) graphregion(color(white) margin(small)) /// scale graphy ; White background instead of Stata blue; margins to create space between figures 
			///graph display, xsize(2.5) ysize(2.5) /// Change these to increase/decrease figure dimensions
			saving(Figure2ENRPEffects.gph, replace)	

****************************** RLPVS x LRScore3
qui regress TotalPassNorm13Diff c.RLPVS##ib2.LRScore3 logForBornPercent MigRateLag WBGDPGrowth i.ICCIStartType if Year >= 1975 , vce(cluster ElectionCode) // 
	margins , at(RLPVS=(0(5)35) LRScore3=(1) ) atmeans post 
	est store Figure2RLPVSMargins1
qui regress TotalPassNorm13Diff c.RLPVS##ib2.LRScore3 logForBornPercent MigRateLag WBGDPGrowth i.ICCIStartType if Year >= 1975 , vce(cluster ElectionCode) // 
	margins , at(RLPVS=(0(5)35) LRScore3=(2) ) atmeans post 
	est store Figure2RLPVSMargins2
qui regress TotalPassNorm13Diff c.RLPVS##ib2.LRScore3 logForBornPercent MigRateLag WBGDPGrowth i.ICCIStartType if Year >= 1975 , vce(cluster ElectionCode) // 
	margins , at(RLPVS=(0(5)35) LRScore3=(3) ) atmeans post 
	est store Figure2RLPVSMargins3
	coefplot ///				 
			(Figure2RLPVSMargins1, label("Left Governments") color(gs6) barwidth(0.25) bargap(1.5) ) ///	Estimates (reordered into a more logical order for results)
			(Figure2RLPVSMargins2, label("Centrist Governments") color(gs12) barwidth(0.25) bargap(1.5)  ) //////		(c) "Offsets" distribute markers so they aren't stacked
			(Figure2RLPVSMargins3, label("Right Governments") color(gs16) barwidth(0.25) bargap(1.5)  ) ///		(c) "Offsets" distribute markers so they aren't stacked
			, ///  
			vertical  ///  
			recast(bar) ///
			plotregion(margin(b=0)) /// Puts the bars right on x axis rather than having any space
			lcolor(black) /// bars will have blackoutline 
			citop barwidth(0.3) fcolor(*.5) /// add conf ints and put them ontop of the bars  
			ciopts(lwidth(*1) lcolor(black)  ) ///
			ylabel(,noticks) ///
			///
			legend (position(6) margin(tiny) bmargin(l+5 t+2)) ///			Position (o'clock and ring = 0 here to put legend in empty cell...
			/// legend (ring(4)) ///											Needs the bmargin settings adjusted to work well.
			legend(rows(2)) ///  											Rows(1) to put all of the legend labels on a horizontal line; cols(1) vert 
			legend(size(*.85) symysize(*.8) symxsize(*.6) keygap(vsmall) ) ///	Relative sizing to change the text size in the legend; gap bw marker and text
			///
			///
			///at recast(line) ///
			///
			///ciopts(recast(rline) lpattern(dash))
			ytitle("Predicted Citizenship Policy Change" , size(*.7) margin (l+.5 ) ) /// Margin moves the label out from the axis 
			yscale(range(-.3(.1).5)) ylabel(-.3(.1).5) ///
			ylabel(,labsize(*.6)) /// Size of the labels on the y-axis 
			ylabel(, grid glwidth(vthin) glcolor(gs10) glpattern(shortdash)) /// Look of the grid
			///
			b1title ("Green and Far Left Vote Share" , size(small)) /// xtitle("ENLP") /// b1title ("`figname'" , size(small)) /// using b1title puts stops the x-title from encroaching on x-axis
		/// Notice: Use "`figname'" so that first loop through grabs first "local figname" above to rotate axis names depending on dv 
			///xscale(range(.5 3.5)) /// Add a little space--.5 units here--at the front and end of the x-axis  
			xlabel(,labsize(*.55)) /// Size of the labels on the x-axis 			
			/// xlabel(, alternate) /// Angle of the labels on the x-axis 	
			/// xlabel(, angle(315)) /// Angle of the labels on the x-axis 	
			/// 
			xlabel( 1 `"0"'  2 `"5"' 3 `"10"' 4 `"15"' 5 `"20"' 6 `"25"' 7 `"30"' 8 `"35"') /// Label the 11 estimates created with each model above
			///
			title("Left Contagion Effects on Citizenship Policy Change",size(*.5) color(black) margin(r+0 b-.5 t+5) ) /// margin(r+10 to move titles (r,l,b, t) to make room
			scale(.9) graphregion(color(white) margin(small)) /// scale graphy ; White background instead of Stata blue; margins to create space between figures 
			///graph display, xsize(2.5) ysize(2.5) /// Change these to increase/decrease figure dimensions
			saving(Figure2RLPVSEffects.gph, replace)	
			///graph export "Figure1Libs1.tif", replace

****************************** RRPVS x LRScore3
qui regress TotalPassNorm13Diff c.RRPVS##ib2.LRScore3 logForBornPercent MigRateLag WBGDPGrowth i.ICCIStartType if Year >= 1975 , vce(cluster ElectionCode) // 
	margins , at(RRPVS=(0(5)30) LRScore3=(1) ) atmeans post 
	est store Figure2RRPVSMargins1
qui regress TotalPassNorm13Diff c.RRPVS##ib2.LRScore3 logForBornPercent MigRateLag WBGDPGrowth i.ICCIStartType if Year >= 1975 , vce(cluster ElectionCode) // 
	margins , at(RRPVS=(0(5)30) LRScore3=(2) ) atmeans post 
	est store Figure2RRPVSMargins2
qui regress TotalPassNorm13Diff c.RRPVS##ib2.LRScore3 logForBornPercent MigRateLag WBGDPGrowth i.ICCIStartType if Year >= 1975 , vce(cluster ElectionCode) // 
	margins , at(RRPVS=(0(5)30) LRScore3=(3) ) atmeans post 
	est store Figure2RRPVSMargins3
	coefplot ///				 
			(Figure2RRPVSMargins1, label("Left Governments") color(gs6) barwidth(0.25) bargap(1.5) ) ///	Estimates (reordered into a more logical order for results)
			(Figure2RRPVSMargins2, label("Centrist Governments") color(gs12) barwidth(0.25) bargap(1.5)  ) //////		(c) "Offsets" distribute markers so they aren't stacked
			(Figure2RRPVSMargins3, label("Right Governments") color(gs16) barwidth(0.25) bargap(1.5)  ) ///		(c) "Offsets" distribute markers so they aren't stacked
			, ///  
			vertical  ///  
			recast(bar) ///
			plotregion(margin(b=0)) /// Puts the bars right on x axis rather than having any space
			lcolor(black) /// bars will have blackoutline 
			citop barwidth(0.3) fcolor(*.5) /// add conf ints and put them ontop of the bars  
			ciopts(lwidth(*1) lcolor(black)  ) ///
			ylabel(,noticks) ///
			///
			legend (position(6) margin(tiny) bmargin(l+5 t+2)) ///			Position (o'clock and ring = 0 here to put legend in empty cell...
			/// legend (ring(4)) ///											Needs the bmargin settings adjusted to work well.
			legend(rows(2)) ///  											Rows(1) to put all of the legend labels on a horizontal line; cols(1) vert 
			legend(size(*.85) symysize(*.8) symxsize(*.6) keygap(vsmall) ) ///	Relative sizing to change the text size in the legend; gap bw marker and text
			///
			///
			///at recast(line) ///
			///
			///ciopts(recast(rline) lpattern(dash))
			ytitle("Predicted Citizenship Policy Change" , size(*.7) margin (l+.5 ) ) /// Margin moves the label out from the axis 
			yscale(range(-.3(.1).5)) ylabel(-.3(.1).5) ///
			ylabel(,labsize(*.6)) /// Size of the labels on the y-axis 
			ylabel(, grid glwidth(vthin) glcolor(gs10) glpattern(shortdash)) /// Look of the grid
			///
			b1title ("Radical Right Party Vote Share" , size(small))  /// xtitle("ENRP Score") /// b1title ("`figname'" , size(small)) /// using b1title puts stops the x-title from encroaching on x-axis
			/// Notice: Use "`figname'" so that first loop through grabs first "local figname" above to rotate axis names depending on dv 
			///xscale(range(.5 5.0)) /// Add a little space--.5 units here--at the front and end of the x-axis  
			xlabel(,labsize(*.55)) /// Size of the labels on the x-axis 			
			/// xlabel(, alternate) /// Angle of the labels on the x-axis 	
			/// xlabel(, angle(315)) /// Angle of the labels on the x-axis 	
			/// 
			xlabel( 1 `"0"'  2 `"5"' 3 `"10"' 4 `"15"' 5 `"20"' 6 `"25"' 7 `"30"' ) /// Label the 11 estimates created with each model above
			///
			title("Right Contagion Effects on Citizenship Policy Change",size(*.5) color(black) margin(r+0 b-.5 t+5) ) /// margin(r+10 to move titles (r,l,b, t) to make room
			scale(.9) graphregion(color(white) margin(small)) /// scale graphy ; White background instead of Stata blue; margins to create space between figures 
			///graph display, xsize(2.5) ysize(2.5) /// Change these to increase/decrease figure dimensions
			saving(Figure2RRPVSEffects.gph, replace)
			
			
		/* Now combine graphs */
			grc1leg /// This is a legend ado that creates one legend when graphs are combined
			  /// VERIFY THAT THESE MATCH "local varnames" 
			 Figure2ENLPEffects.gph ///
			 Figure2ENRPEffects.gph ///
			 Figure2RLPVSEffects.gph ///
			 Figure2RRPVSEffects.gph ///	
			, ///
			/// title(,size(medlarge)) ///
				graphregion(color(white) margin(zero)) 
				graph display, xsize(8) ysize(6.25) // grc1leg won't allow xsize option, but this works	
			///	capture drop  _est*	
		graph export ".\Figure2.tif", width(1500) replace
		
***************************************************************************************************************************************************
*********************** FIGURE 3: BINARY OUTCOMES *************************************************************************************************
****************************** FIGURE 3: Interactive Effects on Binary Outcomes  ********************************************************
////////////////// ENLP AND LIBERALIZATION
qui firthlogit PassAnyLibDummy13 c.ENLP##ib2.LRScore3 logForBornPercent MigRateLag i.ICCIStartType if Year >= 1975, nolog or //
	margins , at(ENLP=(1(.5)3) LRScore3=(1) ) atmeans post expression(invlogit(predict(xb)))
	est store Figure3ENLPLibMargins1
qui firthlogit PassAnyLibDummy13 c.ENLP##ib2.LRScore3 logForBornPercent MigRateLag i.ICCIStartType if Year >= 1975, nolog or //
	margins , at(ENLP=(1(.5)3) LRScore3=(2) ) atmeans post expression(invlogit(predict(xb)))
	est store Figure3ENLPLibMargins2
qui firthlogit PassAnyLibDummy13 c.ENLP##ib2.LRScore3 logForBornPercent MigRateLag i.ICCIStartType if Year >= 1975, nolog or //
	margins , at(ENLP=(1(.5)3) LRScore3=(3) ) atmeans post expression(invlogit(predict(xb)))
	est store Figure3ENLPLibMargins3
	coefplot ///				 
			(Figure3ENLPLibMargins1, msym(S) label("Left Governments")) ///	Estimates (reordered into a more logical order for results)
			(Figure3ENLPLibMargins2, msym(O) label("Centrist Governments") offset(-.2)) ///		(c) "Offsets" distribute markers so they aren't stacked
			(Figure3ENLPLibMargins3, msym(T) label("Right Governments") offset(+.2)) ///		(c) "Offsets" distribute markers so they aren't stacked
			, vertical ///
			///
			mcolor(black) msize(medsmall) /// 		marker characteristics that apply to all of markers
			///
			///
			legend (position(6) margin(tiny) bmargin(l+5 t+2)) ///			Position (o'clock and ring = 0 here to put legend in empty cell...
			/// legend (ring(4)) ///											Needs the bmargin settings adjusted to work well.
			legend(rows(2)) ///  											Rows(1) to put all of the legend labels on a horizontal line; cols(1) vert 
			legend(size(*.85) symysize(*.8) symxsize(*.6) keygap(vsmall) ) ///	Relative sizing to change the text size in the legend; gap bw marker and text
			///
			///
			///at recast(line) ///
			ciopts( ///							Color & width of the CI bands around the estimates 
				lcolor(black) /// 
				lwidth(vthin) ///
				recast(rcap) ///
				) ///
			///
			///ciopts(recast(rline) lpattern(dash))
			ytitle("Probability of Liberalization" , size(*.7) margin (l+.5 ) ) /// Margin moves the label out from the axis 
			yscale(range(0(.2)1)) ylabel(0(.2)1) ///
			ylabel(,labsize(*.6)) /// Size of the labels on the y-axis 
			ylabel(, grid glwidth(vthin) glcolor(gs10) glpattern(shortdash)) /// Look of the grid
			///
			b1title ("ENLP" , size(small)) /// xtitle("ENLP") /// b1title ("`figname'" , size(small)) /// using b1title puts stops the x-title from encroaching on x-axis
		/// Notice: Use "`figname'" so that first loop through grabs first "local figname" above to rotate axis names depending on dv 
			///xscale(range(.5 3.5)) /// Add a little space--.5 units here--at the front and end of the x-axis  
			xlabel(,labsize(*.55)) /// Size of the labels on the x-axis 			
			/// xlabel(, alternate) /// Angle of the labels on the x-axis 	
			/// xlabel(, angle(315)) /// Angle of the labels on the x-axis 	
			/// 
			xlabel( 1 `"1"'  2 `"1.5"' 3 `"2"' 4 `"2.5"' 5 `"3"') /// Label the 11 estimates created with each model above
			///
			title("Marginal Effects of ENLP on Liberalization",size(*.5) color(black) margin(r+0 b-.5 t+5) ) /// margin(r+10 to move titles (r,l,b, t) to make room
			scale(.9) graphregion(color(white) margin(small)) /// scale graphy ; White background instead of Stata blue; margins to create space between figures 
			///graph display, xsize(2.5) ysize(2.5) /// Change these to increase/decrease figure dimensions
			saving(Figure3ENLPLibMargins.gph, replace)	
			///graph export "Figure3ENLPLibs.tif", replace

////////////////// ENRP AND RESTRICTION	
qui firthlogit PassAnyResDummy13 c.ENRP##ib2.LRScore3 logForBornPercent MigRateLag i.ICCIStartType if Year >= 1975, nolog or //
	margins , at(ENRP=(1(.5)3.5) LRScore3=(1) ) atmeans post expression(invlogit(predict(xb)))
	est store Figure3ENRPResMargins1
qui firthlogit PassAnyResDummy13 c.ENRP##ib2.LRScore3 logForBornPercent MigRateLag i.ICCIStartType if Year >= 1975, nolog or //
	margins , at(ENRP=(1(.5)3.5) LRScore3=(2) ) atmeans post expression(invlogit(predict(xb)))
	est store Figure3ENRPResMargins2
qui firthlogit PassAnyResDummy13 c.ENRP##ib2.LRScore3 logForBornPercent MigRateLag i.ICCIStartType if Year >= 1975, nolog or //
	margins , at(ENRP=(1(.5)3.5) LRScore3=(3) ) atmeans post expression(invlogit(predict(xb)))
	est store Figure3ENRPResMargins3
	coefplot ///				 
			(Figure3ENRPResMargins1, msym(S) label("Left Governments")) ///	Estimates (reordered into a more logical order for results)
			(Figure3ENRPResMargins2, msym(O) label("Centrist Governments") offset(-.2)) ///		(c) "Offsets" distribute markers so they aren't stacked
			(Figure3ENRPResMargins3, msym(T) label("Right Governments") offset(+.2)) ///		(c) "Offsets" distribute markers so they aren't stacked
			, vertical ///
			///
			mcolor(black) msize(medsmall) /// 		marker characteristics that apply to all of markers
			///
			///
			legend (position(6) margin(tiny) bmargin(l+5 t+2)) ///			Position (o'clock and ring = 0 here to put legend in empty cell...
			/// legend (ring(4)) ///											Needs the bmargin settings adjusted to work well.
			legend(rows(2)) ///  											Rows(1) to put all of the legend labels on a horizontal line; cols(1) vert 
			legend(size(*.85) symysize(*.8) symxsize(*.6) keygap(vsmall) ) ///	Relative sizing to change the text size in the legend; gap bw marker and text
			///
			///
			///at recast(line) ///
			ciopts( ///							Color & width of the CI bands around the estimates 
				lcolor(black) /// 
				lwidth(vthin) ///
				recast(rcap) ///
				) ///
			///
			///ciopts(recast(rline) lpattern(dash))
			ytitle("Probability of Restriction" , size(*.7) margin (l+.5 ) ) /// Margin moves the label out from the axis 
			yscale(range(0(.2)1)) ylabel(0(.2)1) ///
			ylabel(,labsize(*.6)) /// Size of the labels on the y-axis 
			ylabel(, grid glwidth(vthin) glcolor(gs10) glpattern(shortdash)) /// Look of the grid
			///
			b1title ("ENRP" , size(small))  /// xtitle("ENRP Score") /// b1title ("`figname'" , size(small)) /// using b1title puts stops the x-title from encroaching on x-axis
			/// Notice: Use "`figname'" so that first loop through grabs first "local figname" above to rotate axis names depending on dv 
			///xscale(range(.5 5.0)) /// Add a little space--.5 units here--at the front and end of the x-axis  
			xlabel(,labsize(*.55)) /// Size of the labels on the x-axis 			
			/// xlabel(, alternate) /// Angle of the labels on the x-axis 	
			/// xlabel(, angle(315)) /// Angle of the labels on the x-axis 	
			/// 
			xlabel( 1 `"1"'  2 `"1.5"' 3 `"2"' 4 `"2.5"' 5 `"3"' 6 `"3.5"') /// Label the 11 estimates created with each model above
			///
			title("Marginal Effects of ENRP on Restriction",size(*.5) color(black) margin(r+0 b-.5 t+5) ) /// margin(r+10 to move titles (r,l,b, t) to make room
			scale(.9) graphregion(color(white) margin(small)) /// scale graphy ; White background instead of Stata blue; margins to create space between figures 
			///graph display, xsize(2.5) ysize(2.5) /// Change these to increase/decrease figure dimensions
			saving(Figure3ENRPResMargins.gph, replace)	
			///graph save "Figure1Res1.gph", replace	
			///graph export "Figure1Libs1.tif", replace

////////// RLPVS AND LIBERALIZATION
relogit PassAnyLibDummy13 c.RLPVS##ib2.LRScore3 logForBornPercent MigRateLag i.ICCIStartType if Year >= 1975, nolog or //
	margins , at(RLPVS=(0(5)35) LRScore3=(1) ) atmeans post expression(invlogit(predict(xb)))
	est store Figure3RLPVSLibMargins1
qui firthlogit PassAnyLibDummy13 c.RLPVS##ib2.LRScore3 logForBornPercent MigRateLag i.ICCIStartType if Year >= 1975, nolog or //
	margins , at(RLPVS=(0(5)35) LRScore3=(2) ) atmeans post expression(invlogit(predict(xb)))
	est store Figure3RLPVSLibMargins2
qui firthlogit PassAnyLibDummy13 c.RLPVS##ib2.LRScore3 logForBornPercent MigRateLag i.ICCIStartType if Year >= 1975, nolog or //
	margins , at(RLPVS=(0(5)35) LRScore3=(3) ) atmeans post expression(invlogit(predict(xb)))
	est store Figure3RLPVSLibMargins3
	coefplot ///				 
			(Figure3RLPVSLibMargins1, msym(S) label("Left Governments")) ///	Estimates (reordered into a more logical order for results)
			(Figure3RLPVSLibMargins2, msym(O) label("Centrist Governments") offset(-.2)) ///		(c) "Offsets" distribute markers so they aren't stacked
			(Figure3RLPVSLibMargins3, msym(T) label("Right Governments") offset(+.2)) ///		(c) "Offsets" distribute markers so they aren't stacked
			, vertical ///
			///
			mcolor(black) msize(medsmall) /// 		marker characteristics that apply to all of markers
			///
			///
			legend (position(6) margin(tiny) bmargin(l+5 t+2)) ///			Position (o'clock and ring = 0 here to put legend in empty cell...
			/// legend (ring(4)) ///											Needs the bmargin settings adjusted to work well.
			legend(rows(2)) ///  											Rows(1) to put all of the legend labels on a horizontal line; cols(1) vert 
			legend(size(*.85) symysize(*.8) symxsize(*.6) keygap(vsmall) ) ///	Relative sizing to change the text size in the legend; gap bw marker and text
			///
			///
			///at recast(line) ///
			ciopts( ///							Color & width of the CI bands around the estimates 
				lcolor(black) /// 
				lwidth(vthin) ///
				recast(rcap) ///
				) ///
			///
			///ciopts(recast(rline) lpattern(dash))
			ytitle("Probability of Liberalization" , size(*.7) margin (l+.5 ) ) /// Margin moves the label out from the axis 
			yscale(range(0(.2)1)) ylabel(0(.2)1) ///
			ylabel(,labsize(*.6)) /// Size of the labels on the y-axis 
			ylabel(, grid glwidth(vthin) glcolor(gs10) glpattern(shortdash)) /// Look of the grid
			///
			xtitle("Green/Far Left Party Vote Share" , size(*.7) margin (l+.5 ) ) ///) b1title ("`figname'" , size(small)) /// using b1title puts stops the x-title from encroaching on x-axis
		/// Notice: Use "`figname'" so that first loop through grabs first "local figname" above to rotate axis names depending on dv 
			///xscale(range(.5 3.5)) /// Add a little space--.5 units here--at the front and end of the x-axis  
			xlabel(,labsize(*.55)) /// Size of the labels on the x-axis 			
			/// xlabel(, alternate) /// Angle of the labels on the x-axis 	
			/// xlabel(, angle(315)) /// Angle of the labels on the x-axis 	
			/// 
			xlabel( 1 `"0"'  2 `"5"' 3 `"10"' 4 `"15"' 5 `"20"' 6 `"25"' 7 `"30"' 8 `"35"') /// Label the 11 estimates created with each model above
			///
			title("Marginal Effects of Green/Far Left Vote Share on Liberalization",size(*.5) color(black) margin(r+0 b-.5 t+5) ) /// margin(r+10 to move titles (r,l,b, t) to make room
			scale(.9) graphregion(color(white) margin(small)) // scale graphy ; White background instead of Stata blue; margins to create space between figures 
			graph display, xsize(2.5) ysize(2.5) // Change these to increase/decrease figure dimensions
			graph save "Figure3RLPVSLibMargins.gph", replace	
			///graph export "Figure1Libs1.tif", replace

//////////// RRPVS AND RESTRICTION
qui firthlogit PassAnyResDummy13 c.RRPVS##ib2.LRScore3 logForBornPercent MigRateLag i.ICCIStartType if Year >= 1975, nolog or //
	margins , at(RRPVS=(0(5)25) LRScore3=(1) ) atmeans post expression(invlogit(predict(xb)))
	est store Figure3RRPVSResMargins1
qui firthlogit PassAnyResDummy13 c.RRPVS##ib2.LRScore3 logForBornPercent MigRateLag i.ICCIStartType if Year >= 1975, nolog or //
	margins , at(RRPVS=(0(5)25) LRScore3=(2) ) atmeans post expression(invlogit(predict(xb)))
	est store Figure3RRPVSResMargins2
qui firthlogit PassAnyResDummy13 c.RRPVS##ib2.LRScore3 logForBornPercent MigRateLag i.ICCIStartType if Year >= 1975, nolog or //
	margins , at(RRPVS=(0(5)25) LRScore3=(3) ) atmeans post expression(invlogit(predict(xb)))
	est store Figure3RRPVSResMargins3
	coefplot ///				 
			(Figure3RRPVSResMargins1, msym(S) label("Left Governments")) ///	Estimates (reordered into a more logical order for results)
			(Figure3RRPVSResMargins2, msym(O) label("Centrist Governments") offset(-.2)) ///		(c) "Offsets" distribute markers so they aren't stacked
			(Figure3RRPVSResMargins3, msym(T) label("Right Governments") offset(+.2)) ///		(c) "Offsets" distribute markers so they aren't stacked
			, vertical ///
			///
			mcolor(black) msize(medsmall) /// 		marker characteristics that apply to all of markers
			///
			///
			legend (position(6) margin(tiny) bmargin(l+5 t+2)) ///			Position (o'clock and ring = 0 here to put legend in empty cell...
			/// legend (ring(4)) ///											Needs the bmargin settings adjusted to work well.
			legend(rows(2)) ///  											Rows(1) to put all of the legend labels on a horizontal line; cols(1) vert 
			legend(size(*.85) symysize(*.8) symxsize(*.6) keygap(vsmall) ) ///	Relative sizing to change the text size in the legend; gap bw marker and text
			///
			///
			///at recast(line) ///
			ciopts( ///							Color & width of the CI bands around the estimates 
				lcolor(black) /// 
				lwidth(vthin) ///
				recast(rcap) ///
				) ///
			///
			///ciopts(recast(rline) lpattern(dash))
			ytitle("Probability of Restriction" , size(*.7) margin (l+.5 ) ) /// Margin moves the label out from the axis 
			yscale(range(0(.2)1)) ylabel(0(.2)1) ///
			ylabel(,labsize(*.6)) /// Size of the labels on the y-axis 
			ylabel(, grid glwidth(vthin) glcolor(gs10) glpattern(shortdash)) /// Look of the grid
			///
			xtitle("Radical Right Party Vote Share" , size(*.7) margin (l+.5 ) ) ///) b1title ("`figname'" , size(small)) /// using b1title puts stops the x-title from encroaching on x-axis
		/// Notice: Use "`figname'" so that first loop through grabs first "local figname" above to rotate axis names depending on dv 
			///xscale(range(.5 5.0)) /// Add a little space--.5 units here--at the front and end of the x-axis  
			xlabel(,labsize(*.55)) /// Size of the labels on the x-axis 			
			/// xlabel(, alternate) /// Angle of the labels on the x-axis 	
			/// xlabel(, angle(315)) /// Angle of the labels on the x-axis 	
			/// 
			xlabel( 1 `"0"'  2 `"5"' 3 `"10"' 4 `"15"' 5 `"20"' 6 `"25"' ) /// Label the 11 estimates created with each model above
			///
			title("Marginal Effects of Radical Right Party Vote Share on Restriction",size(*.5) color(black) margin(r+0 b-.5 t+5) ) /// margin(r+10 to move titles (r,l,b, t) to make room
			scale(.9) graphregion(color(white) margin(small)) // scale graphy ; White background instead of Stata blue; margins to create space between figures 
			graph display, xsize(2.5) ysize(2.5) // Change these to increase/decrease figure dimensions
			graph save "Figure3RRPVSResMargins.gph", replace	
			///graph export "Figure1Res1.tif", replace			
						
/* Now combine graphs */
			grc1leg /// This is a legend ado that creates one legend when graphs are combined
			  /// VERIFY THAT THESE MATCH "local varnames" 
			 Figure3ENLPLibMargins.gph ///
			 Figure3ENRPResMargins.gph ///
			 Figure3RLPVSLibMargins.gph ///
			 Figure3RRPVSResMargins.gph ///	
			, ///
			/// title(,size(medlarge)) ///
				graphregion(color(white) margin(zero)) 
				graph display, xsize(8) ysize(6.25) // grc1leg won't allow xsize option, but this works	
			///	capture drop  _est*	
		graph export ".\Figure 3.tif", width(1500) replace
	